from langchain.chat_models import init_chat_model
from langchain_core.prompts import PromptTemplate

# prompt = PromptTemplate.from_template("地点:{address},请给我讲个关于{subject}的笑话")
#
# prompt_str = prompt.format(subject="王科宇",address="非洲")
# print(prompt_str)
#

template = PromptTemplate.from_file("example_prompt_template.txt")
prompt = template.format(
    topic="王八"
)

print(prompt)

model = init_chat_model("deepseek-chat", model_provider="deepseek")
for token in model.stream(prompt):
    print(token.content, end="")
